/* jshint esversion: 6 */
const Router = require('koa-router');
const tool = require("../../tools/tool");
const router = new Router();
// 修改密码

router.post('/user/login', async ctx => {
    let username = ctx.request.body.username;
    let userpwd = ctx.request.body.userpwd;
    if (!username) return ctx.err('请输入用户名');
    if (!userpwd) return ctx.err('请输入密码');
    username = username.trim();
    userpwd = userpwd.trim();
    return await tool.login(username, userpwd, ctx)
})


module.exports = router;